var memberUtil=require('../../utils/memberUtil');
var app = getApp();
Page({

  /* 页面的初始数据 */
	data: {
		cashInfo: "提现信息",
		ishide: false,
		yjItems:[]
	},
	lookMore: function () {
		console.log(this.data)
		this.setData({
			ishide: !this.data.ishide
		})
	},
  /* 生命周期函数--监听页面加载 */
	onLoad: function (options) {
		var that=this;
		wx.setNavigationBarTitle({
			title: '佣金提现记录'
		})
		that.setData({
			userInfo: wx.getStorageSync("loginUserInfo").userInfo==undefined?"":wx.getStorageSync("loginUserInfo").userInfo,
		});
		if(that.data.userInfo.id==undefined) {
			memberUtil.getLogin(app,0,1,that,2);
		}
	},

  /*生命周期函数--监听页面初次渲染完成 */
	onReady: function () {

	},

  /* 生命周期函数--监听页面显示 */
	onShow: function () {
		var that =this;
		var memberIdJson = { memberId:that.data.userInfo.id}
		wx.request({
			url: app.globalData.baseUrl+ '/drawcash/findApplyListByMemberId',
			method: 'POST',
			data: JSON.stringify(memberIdJson),
			success:function(e){
				if(e.statusCode==200){
					that.setData({
						yjItems:e.data
					})
				}
			},
			fail:function(){

			}
		})
	},

  /* 生命周期函数--监听页面隐藏 */
	onHide: function () {

	},

  /**
   * 生命周期函数--监听页面卸载
   */
	onUnload: function () {

	},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
	onPullDownRefresh: function () {

	},

  /**
   * 页面上拉触底事件的处理函数
   */
	onReachBottom: function () {

	},

  /**
   * 用户点击右上角分享
   */
	onShareAppMessage: function () {
	  var that=this;
	  return {
		  title: '我的二维码',
		  path: "/pages/shop/shareSuccess?parentId=" + that.data.userInfo.id + "&enterType=0",
		  imageUrl: app.globalData.loginUserInfo.erweimaUrl
	  }
	}
})